package 面向对象_中.a继承;

/**
 * @Projectname java_based
 * @Filename Person
 * @Author an
 * @Data 2022/6/29 16:04
 * @Description TODO
 */

/*
 * 为描述和处理个人信息，定义类 Person
 */
public class Person extends Creature {

    String name;
    private int age;

    public Person(){

    }

    public Person(String name,int age){
        this.name = name;
        this.age = age;
    }

    public void eat(){
        System.out.println("吃饭");
        sleep();
    }

    private void sleep(){
        System.out.println("睡觉");
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

}
